import { useRef, useState } from "react";
import { WebSocketX } from "../ws/WebSocketX";

const paramIMUrl = 'http://localhost:7001';
let ws: WebSocketX | null;

export function useStaffIm() {

  if (!ws) {
    ws = new WebSocketX(paramIMUrl, { name: 'staffIm' }); // 用于对话
  }

  return ws;
}